package com.echo.code.spring.core;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/14
 */
public class Client {

  public static void main(String[] args) {
    ConfigurableApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
    Person person = context.getBean("person", Person.class);
    System.out.println(person);
    SystemConfig config = context.getBean("systemConfig", SystemConfig.class);
    System.out.println(config);
    context.close();

    /*AnnotationConfigApplicationContext configApplicationContext = new AnnotationConfigApplicationContext();
    configApplicationContext.register(StudentConfig.class);
    configApplicationContext.register(TeacherConfig.class);
    configApplicationContext.refresh();
    Student student = configApplicationContext.getBean("student", Student.class);
    System.out.println(student);
    Teacher teacher = configApplicationContext.getBean("teacher", Teacher.class);
    System.out.println(teacher);
    configApplicationContext.close();*/
  }
}
